package com.lfs.dingtalk.robot.web;

import com.lfs.dingtalk.robot.domain.MsgParam;
import com.lfs.dingtalk.robot.servcie.DingtalkSendService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/dingtalk/send")
@RestController
@Slf4j
@AllArgsConstructor
public class DingtalkSendController {
    DingtalkSendService dingtalkSendService;

    @GetMapping(value = "/normal")
    public String sendNormal(){
        return dingtalkSendService.sendToUser("sampleMarkdown", MsgParam.builder()
                        .title("标题")
                        .text("# 正文")
                .build());
    }
}
